/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.crystalrange.documents.service;

import com.googlecode.genericdao.search.Search;
import com.googlecode.genericdao.search.SearchResult;
import java.util.List;
import org.crystalrange.documents.model.DocumentGroup;
import org.springframework.security.access.prepost.PreAuthorize;

/**
 *
 * @author Krzysiek
 */
public interface DocumentGroupService {
    public DocumentGroup create(String username);
       
    @PreAuthorize("hasRole('RIGHT_DOCUMENT_GROUP_SAVE')")
    public boolean save(DocumentGroup documentGroup);

    @PreAuthorize("hasRole('RIGHT_DOCUMENT_GROUP_REMOVE')")
    public boolean remove(DocumentGroup documentGroup);

    @PreAuthorize("hasRole('RIGHT_DOCUMENT_GROUP_READ')")
    public DocumentGroup find(Long id);

    @PreAuthorize("hasRole('RIGHT_DOCUMENT_GROUP_READ')")
    public List<DocumentGroup> findAll();
    
    @PreAuthorize("hasRole('RIGHT_DOCUMENT_GROUP_READ')")
    public SearchResult<DocumentGroup> searchAndCount(Search search);

    @PreAuthorize("hasRole('RIGHT_DOCUMENT_GROUP_READ')")
    public List<DocumentGroup> search(Search search);
    
    @PreAuthorize("hasRole('RIGHT_DOCUMENT_GROUP_READ')")
    public DocumentGroup searchUnique(Search search);
}
